<?php


namespace app\api\controller;


use app\api\service\JwtAuth;
use app\common\model\Users;
use think\facade\Db;
use think\facade\Request;

class Article extends Base
{
    /**
     * 控制器中间件 [登录、注册 不需要鉴权]
     * @var array
     */
    protected $middleware = [
        'app\api\middleware\Api' => ['except' => ['index','answer']],
    ];


    public function index()
    {
        $articleList = \app\common\model\Article::where('cate_id', 6)->where('status', 1)->order('sort')->order('id', 'desc')->select();
        return $this->result($articleList, 0, 1, '');
    }

    public function answer()
    {
        $articleList = \app\common\model\Article::where('cate_id', 5)->where('status', 1)->order('sort')->order('id', 'desc')->select();
        return $this->result($articleList, 0, 1, '');
    }
}
